package com.hckj.managersystemdemo.entity;

import org.springframework.stereotype.Component;

import java.util.Objects;
/**
 * @description 实体类
 *
 * @author itbac
 * @email 1218585258@qq.com
 * @date 2020/7/4
 */
@Component
public class Users {
    private int id;
    private String username;
    private String password;
    private String name;
    private String userSex;

    public Users() {
    }

    public Users(int id, String username, String password, String name, String userSex) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.name = name;
        this.userSex = userSex;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getUserSex() {
        return userSex;
    }

    public void setUserSex(String userSex) {
        this.userSex = userSex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Users users = (Users) o;
        return id == users.id &&
                Objects.equals(username, users.username) &&
                Objects.equals(password, users.password) &&
                Objects.equals(name, users.name) &&
                Objects.equals(userSex, users.userSex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, password, name, userSex);
    }

    @Override
    public String toString() {
        return "{" +
                "\"id\":" + id +
                ", \"username\":\"" + username + '\"' +
                ", \"password\":\"" + password + '\"' +
                ", \"name\":\"" + name + '\"' +
                ", \"userSex\":\"" + userSex + '\"' +
                '}';
    }
}
